import { AxiosPromise } from 'axios';
import request from '@/utils/request';

export function labelsList(query: any): AxiosPromise<any[]> {
  return request({
    url: '/wiki/labels/list',
    method: 'get',
    params: query
  });
}

export function labelsDetail(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/labels/' + id,
    method: 'get'
  });
}

export function saveLabels(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/labels',
    method: 'post',
    data
  });
}

export function updateLabels(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/labels',
    method: 'put',
    data
  });
}

export function deleteLabels(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/labels/' + id,
    method: 'delete'
  });
}
